import request from '@/utils/request'

// 查询商品列表列表
export function listGoods(query) {
  return request({
    url: '/business/goods/list',
    method: 'get',
    params: query
  })
}

// 查询商品列表详细
export function getGoods(goodsId) {
  return request({
    url: '/business/goods/' + goodsId,
    method: 'get'
  })
}
export function getGoodsTree(data) {nv
    return request({
        url: '/business/goods/goodTree',
        method: 'post',
        data:data
    })
}
// 新增商品列表
export function addGoods(data) {
  return request({
    url: '/business/goods',
    method: 'post',
    data: data
  })
}
export function batchGoods(data) {
    return request({
        url: '/business/goods/batchGoods',
        method: 'post',
        data: data
    })
}



// 修改商品列表
export function updateGoods(data) {
  return request({
    url: '/business/goods',
    method: 'put',
    data: data
  })
}

// 删除商品列表
export function delGoods(goodsId) {
  return request({
    url: '/business/goods/' + goodsId,
    method: 'delete'
  })
}
export function changeGoodsStatus(goodsId, status) {
    const data = {
        goodsId,
        status
    }
    return request({
        url: '/business/goods/changeStatus',
        method: 'put',
        data: data
    })
}
export function changeAuditStatus(goodsId, audit) {
    const data = {
        goodsId,
        audit
    }
    return request({
        url: '/business/goods',
        method: 'put',
        data: data
    })
}
export function requestBathAudit() {

    return request({
        url: '/business/goods/batchAudit',
        method: 'put'
    })
}

